#!/usr/bin/env python
"""
import urllib2, urllib, json, time


#Get data
response = urllib.urlopen("https://atlas.ripe.net/api/v1/probe/?fields=status,id,country_code,prefix_v4,asn&limit=77")
jsondata = json.loads(response.read())
(true,false,null) = (True,False,None)
result = eval(str(jsondata))
asn = [i.get("asn") for i in result.get("objects") if i.get("status") == 1] 
print "Get all probes from different ASNs "+str(len(sorted(set(asn))))
#print sorted(set(asn))


#response = urllib.urlopen("https://atlas.ripe.net/api/v1/probe/?fields=status,id,country_code,prefix_v4,asn&limit=7700")
#jsondata = json.loads(response.read())
#(true,false,null) = (True,False,None)
#result = eval(str(jsondata))
prefix = [i.get("prefix_v4") for i in result.get("objects") if i.get("status") == 1 and i.get("prefix_v4") is not None] 
print "Get all probes from different prefixes "+str(len(set(prefix)))
print set(prefix)
#print sorted(set(prefix))
"""
"""
from itertools import *
from operator import itemgetter

d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3)
di = sorted(d.iteritems(), key=itemgetter(1))
print d
print di
for k, g in groupby(di, key=itemgetter(1)):
    print k, map(itemgetter(0), g)
"""

print 
